# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=qstylizer
pkgname=python-${_pkg}
pkgver=0.2.2
pkgrel=2
pkgdesc="Qt stylesheet generation utility for PyQt/PySide"
arch=(any)
url="https://github.com/blambright/qstylizer"
license=(MIT)
depends=(python-inflection python-tinycss2)
makedepends=(python-pbr python-setuptools)
checkdepends=(
    python-pytest
    python-pytest-runner
    python-pytest-mock
)
#source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('95f7666929cc34efbbd9e0640a13f507b8ec35ec34a9604017cf96c24f7f9ea6')

build() {
  cd ${_pkg}-${pkgver}
  export PBR_VERSION=${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}-${pkgver}
  PYTHONPATH="${PWD}"/build/lib/ pytest
}

package() {
  cd ${_pkg}-${pkgver}
  export PBR_VERSION=${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}/
}
